<div class="groups view">
	<h2><?php  echo __('Group');?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd><?php echo h($group['Group']['id']); ?>&nbsp;</dd>
		<dt><?php echo __('Tenant'); ?></dt>
		<dd><?php echo $this->Html->link($group['Tenant']['name'], array('controller' => 'tenants', 'action' => 'view', $group['Tenant']['id'])); ?>&nbsp;</dd>
		<dt><?php echo __('Parent Group'); ?></dt>
		<dd><?php echo $this->Html->link($group['ParentGroup']['name'], array('controller' => 'groups', 'action' => 'view', $group['ParentGroup']['id'])); ?>&nbsp;</dd>
		<dt><?php echo __('Deleted'); ?></dt>
		<dd><?php echo h($group['Group']['deleted']); ?>&nbsp;</dd>
		<dt><?php echo __('Name'); ?></dt>
		<dd><?php echo h($group['Group']['name']); ?>&nbsp;</dd>
		<dt><?php echo __('Gmt Deleted'); ?></dt>
		<dd><?php echo h($group['Group']['gmt_deleted']); ?>&nbsp;</dd>
		<dt><?php echo __('Gmt Created'); ?></dt>
		<dd><?php echo h($group['Group']['gmt_created']); ?>&nbsp;</dd>
		<dt><?php echo __('Gmt Modified'); ?></dt>
		<dd><?php echo h($group['Group']['gmt_modified']); ?>&nbsp;</dd>
	</dl>
</div>

<?php echo $this->element('menu'); ?>

<div class="related">
	<h3><?php echo __('Related Groups');?></h3>

	<?php if (!empty($group['ChildGroup'])):?>

	<table cellpadding = "0" cellspacing = "0"  class="groups datatable">
		<thead>
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Tenant Id'); ?></th>
				<th><?php echo __('Parent Id'); ?></th>
				<th><?php echo __('Deleted'); ?></th>
				<th><?php echo __('Name'); ?></th>
				<th><?php echo __('Gmt Deleted'); ?></th>
				<th><?php echo __('Gmt Created'); ?></th>
				<th><?php echo __('Gmt Modified'); ?></th>
				<th class="actions"><?php echo __('Actions');?></th>
			</tr>
		</thead>
		<tbody>
		<?php $i = 0; foreach ($group['ChildGroup'] as $childGroup): ?>
			<tr>
				<td><?php echo $childGroup['id'];?></td>
				<td><?php echo $childGroup['tenant_id'];?></td>
				<td><?php echo $childGroup['parent_id'];?></td>
				<td><?php echo $childGroup['deleted'];?></td>
				<td><?php echo $childGroup['name'];?></td>
				<td><?php echo $childGroup['gmt_deleted'];?></td>
				<td><?php echo $childGroup['gmt_created'];?></td>
				<td><?php echo $childGroup['gmt_modified'];?></td>
				<td class="actions">
					<?php echo $this->Html->link(__('View'), array('controller' => 'groups', 'action' => 'view', $childGroup['id'])); ?>
					<?php echo $this->Html->link(__('Edit'), array('controller' => 'groups', 'action' => 'edit', $childGroup['id'])); ?>
					<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'groups', 'action' => 'delete', $childGroup['id']), null, __('Are you sure you want to delete # %s?', $childGroup['id'])); ?>
				</td>
			</tr>
		<?php endforeach; ?>
		</tbody>
	</table>

	<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Child Group'), array('controller' => 'groups', 'action' => 'add'));?> </li>
		</ul>
	</div>

</div>

<div class="related">
	<h3><?php echo __('Related Users');?></h3>

	<?php if (!empty($group['User'])):?>

	<table cellpadding = "0" cellspacing = "0"  class="users datatable">
		<thead>
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Tenant Id'); ?></th>
				<th><?php echo __('Deleted'); ?></th>
				<th><?php echo __('Group Id'); ?></th>
				<th><?php echo __('Active'); ?></th>
				<th><?php echo __('Name'); ?></th>
				<th><?php echo __('Password'); ?></th>
				<th><?php echo __('Mobile'); ?></th>
				<th><?php echo __('Email'); ?></th>
				<th><?php echo __('Ip Last Login'); ?></th>
				<th><?php echo __('Ip Registered'); ?></th>
				<th><?php echo __('Gmt Last Login'); ?></th>
				<th><?php echo __('Gmt Registered'); ?></th>
				<th><?php echo __('Gmt Created'); ?></th>
				<th><?php echo __('Gmt Deleted'); ?></th>
				<th><?php echo __('Gmt Modified'); ?></th>
				<th class="actions"><?php echo __('Actions');?></th>
			</tr>
		</thead>
		<tbody>
		<?php $i = 0; foreach ($group['User'] as $user): ?>
			<tr>
				<td><?php echo $user['id'];?></td>
				<td><?php echo $user['tenant_id'];?></td>
				<td><?php echo $user['deleted'];?></td>
				<td><?php echo $user['group_id'];?></td>
				<td><?php echo $user['active'];?></td>
				<td><?php echo $user['name'];?></td>
				<td><?php echo $user['password'];?></td>
				<td><?php echo $user['mobile'];?></td>
				<td><?php echo $user['email'];?></td>
				<td><?php echo $user['ip_last_login'];?></td>
				<td><?php echo $user['ip_registered'];?></td>
				<td><?php echo $user['gmt_last_login'];?></td>
				<td><?php echo $user['gmt_registered'];?></td>
				<td><?php echo $user['gmt_created'];?></td>
				<td><?php echo $user['gmt_deleted'];?></td>
				<td><?php echo $user['gmt_modified'];?></td>
				<td class="actions">
					<?php echo $this->Html->link(__('View'), array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
					<?php echo $this->Html->link(__('Edit'), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
					<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'users', 'action' => 'delete', $user['id']), null, __('Are you sure you want to delete # %s?', $user['id'])); ?>
				</td>
			</tr>
		<?php endforeach; ?>
		</tbody>
	</table>

	<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add'));?> </li>
		</ul>
	</div>

</div>
